## S3 method for class 'iModel':
stepwise(object,
criterion = "aic", alpha = NULL, type ="decomposable",
search="all", steps = 1000, k = 2,
direction = "backward", fixinMAT=NULL, fixoutMAT=NULL,
details = 0, trace = 2, ...)
backward(object,
criterion = "aic", alpha = NULL, type = "decomposable",
search="all", steps = 1000, k = 2,
fixinMAT=NULL, details = 1, trace = 2,...)
forward(object,
criterion = "aic", alpha = NULL, type = "decomposable",
search="all", steps = 1000, k = 2,
fixoutMAT=NULL, details = 1, trace = 2,...)
iModel
model object"aic"
or "test"
(for
significance test)criterion="aic"
, alpha
defaults to
0; when criterion="test"
, alpha
defaults to 0.05."decomposable"
or
"unrestricted"
. If type="decomposable"
and the initial
model is decompsable, then the search is among decomposable models
only.'all'
(greedy) or 'headlong'
(search edges randomly; stop when an improvement has been found).criterion="aic"
. Only k=2 gives
genuine AIC."backward"
or "forward"
.testdelete
(for testInEdges
) and testadd
(for testOutEdges
).iModel
model object.cmod
dmod
mmod
testInEdges
testOutEdges
data(reinis)
## The saturated model
m1 <- dmod(~.^., data=reinis)
m2 <- stepwise(m1)
m2
Run the code above in your browser using DataLab